package com.happyrecyclingstation.mapper;

import com.github.pagehelper.Page;
import com.happyrecyclingstation.dto.AIResumeQuery;
import com.happyrecyclingstation.entity.Resume;
import com.happyrecyclingstation.vo.HrResumeVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface ResumeMapper {

    /**
     * 根据用户id查询简历
     * @param uId
     * @return
     */
    @Select("select * from lzxm_resume where user_id = #{uId}")
    Resume getResumeByUserId(Integer uId);

    /**
     * 更新简历
     * @param resume
     */
    void updateResume(Resume resume);

    /**
     * 插入简历
     * @param resume
     */
    void insertResume(Resume resume);

    Page<HrResumeVO> getResume(Integer companyId, Integer posId, Short isView, LocalDateTime createTime);

    /**
     * 根据id查询简历
     * @param id
     * @return
     */
    @Select("select * from lzxm_resume where id = #{id}")
    Resume getResumeById(Integer id);

    /**
     * ai根据条件查询简历
     * @param query
     * @return
     */
    List<Resume> getAiResume(AIResumeQuery query);
}
